'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  const jwt = app.middleware.jwt(app.config.jwt);

  router.post('/user/login', controller.user.login);
  router.get('/user/getUsersUdparts', jwt, controller.user.getUsersUdparts);
  router.get('/user/getUser/:id', jwt, controller.user.getUser);
  router.get('/user/searchUsers', jwt, controller.user.searchUsers);
  router.get('/user/delUser/:id', jwt, controller.user.delUser);
  router.post('/user/addUser', jwt, controller.user.addUser);
  router.post('/user/updateUser', jwt, controller.user.updateUser);

  router.get('/dparts', jwt, controller.dpart.getDparts);
};
